type file; app (file o) mywc (file inputfile) { mywc @inputfile stdout=@o; } file headerfiles[] ; file out[]; #foreach j in [1:toInt(arg("n","1"))] { # out[j] = mywc(headerfiles[j]); #} foreach f,j in headerfiles { // %M expands the filename tracef("%M,%i\n",f,j); out[j]= mywc(f); }